//: Playground - noun: a place where people can play

import UIKit
import MilanoSDK

let destination = BaseDestination()
var format = ""

let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
let dateStr = formatter.string(from: Date())

// format = "Hello"
// destination.formatMessage(format, level: .verbose, msg: "Hello", thread: "main",
//                          file: "/path/to/ViewController.swift", function: "test()", line: 50)
//
// format = "$"
// destination.formatMessage(format, level: .verbose, msg: "Hello", thread: "main",
//                          file: "/path/to/ViewController.swift", function: "test()", line: 50)
//
// format = "$DHH:mm:ss.SSS$d $L $N.$F:$l - $M"
// destination.formatMessage(format, level: .verbose, msg: "Hello", thread: "main",
//                          file: "/path/to/ViewController.swift", function: "test()", line: 50)

Filters.path.contains("/some/path", required: true).apply("/some/path")

Filter.TargetType.function(Filter.ComparisonType.contains([], true)) == Filter.TargetType.function(Filter.ComparisonType.contains([], true))

"123".components(separatedBy: "/").last
"123".components(separatedBy: ".").first
"/".components(separatedBy: "/")
"/.".components(separatedBy: "./")
"你好".components(separatedBy: "./")

let console = ConsoleDestination()
console.minLevel = .info
Log.addDestination(console)

// console.addFilter(Filters.message.contains("he", caseSensitive: true, required: true, minLevel: .verbose))
// console.addFilter(Filters.message.contains("ha", caseSensitive: true, required: true, minLevel: .verbose))
// Log.verbose("hello")
// Log.warning("warning")

console.addFilter(Filters.message.excludes("hello", required: true))
Log.info("haha")
Log.info("hello")
Log.warning("world")

console == ConsoleDestination()
ObjectIdentifier(console) == ObjectIdentifier(ConsoleDestination())
console == console
ObjectIdentifier(console) == ObjectIdentifier(console)
